home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / interapplication comm / menuscripter / sources / debugutils.c next >
Encoding:
Text File  |  2000-06-23  |  711 b   |  40 lines

  1. // DebugUtils.c
  2. //
  3. // Original version by Jon Lansdell and Nigel Humphreys.
  4. // 4.0 and 3.1 updates by Greg Sutton.
  5. // ©Apple Computer Inc 1996, all rights reserved.
  6.  
  7. #include "DebugUtils.h"
  8.  
  9.  
  10. #include <Memory.h>
  11. #include <TextUtils.h>
  12.  
  13.  
  14.  
  15.  
  16. void DebugNum ( long err )
  17. {
  18.     Str255 str;
  19.     
  20.     NumToString ( (long) err , (StringPtr) &str );
  21.     DebugStr(str);
  22.     
  23. }
  24.  
  25.  
  26.  
  27. void DebugStrNum ( Str255 str, long num )
  28. {
  29.     Str255 debug_str, tmp_str;
  30.     
  31.     BlockMove ( &str[0], &debug_str[0], str[0] + 1 );
  32.     
  33.     NumToString ( ( long ) num , &tmp_str[0] );
  34.     debug_str[ debug_str[0] + 1 ] = ' ';
  35.     BlockMove ( &tmp_str[1], &debug_str[ debug_str[0] + 2 ], tmp_str[0] );
  36.     debug_str[0] = debug_str[0] + tmp_str[0] + 1;
  37.     DebugStr ( debug_str );
  38. }
  39.  
  40.